{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5f61dac5",
   "metadata": {},
   "source": [
    "----------\n",
    "本学习记录人:  \n",
    "学习时间：2021-11-18  \n",
    "week07   \n",
    "[参考的文档](https://www.python.org/doc/)  \n",
    "[许老师博客](https://www.cnblogs.com/xuzhichao)  \n",
    "\n",
    "---\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9dd7526c",
   "metadata": {},
   "source": [
    "# 回顾上周内容：\n",
    "## 1.认识列表：[value1,value2,value3...]\n",
    "## 2.列表的查询：\n",
    "\n",
    "> 1.索引值进行查询  （单个值）：index\n",
    "\n",
    "> 2.切片进行查询  （多值）：slice\n",
    "\n",
    "## 3.列表的一般方法\n",
    "\n",
    "> 1.增加元素    \n",
    ">> 1.append.()增加元素至列表的末位 : L.append(object)  \n",
    ">> 2.insert.()指定位置增加元素 : L.insert(index) \n",
    "\n",
    "> 2.删除元素     \n",
    ">> 1.remove.()按照值进行删除 : L.remove(value)   \n",
    ">> 2.pop.() 按照索引值进行删除： L.pop(index) 注意：不写index 默认删除列表的最后一个元素   \n",
    "\n",
    "> 3.修改内容   \n",
    "> 4.查询内容  （参考上述2）  "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3ccbe08",
   "metadata": {},
   "source": [
    "# 本周内容\n",
    "\n",
    "## 1.列表的其他方法\n",
    "\n",
    "## 2.列表的实践（课本）\n",
    "\n",
    "## 3.列表的实践（课外）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "id": "fb723780",
   "metadata": {},
   "outputs": [],
   "source": [
    "names= [\"Make\",\"Marry\",\"Jan\",\"Jake\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "50865ccd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Make', 'Marry', 'Jan', 'Jake']"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "names"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e592de8d",
   "metadata": {},
   "source": [
    "> 1.clear"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "9102e6e5",
   "metadata": {},
   "outputs": [],
   "source": [
    "names.clear()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "a7736b38",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "names"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3849efa",
   "metadata": {},
   "source": [
    "> 2.count： \n",
    "A 使用方法： L.count(value)\n",
    "B.结果：查询某个value出现的次数（共现的次数），通常用在计算词频、统计操作当中"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "071c2c6b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[88, 89, 68, 78, 88, 90, 93, 88]"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "分数_list = [88,89,68,78,88,90,93,88]\n",
    "分数_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "id": "2df2d060",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "分数_list.count(68)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aace33fe",
   "metadata": {},
   "source": [
    "> 3.extend()扩展\n",
    ">> 1.使用方法:L.extend(iterable)  \n",
    ">> 2.结果: iterable 将拼接在 L 的后面（末尾）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "5f141819",
   "metadata": {},
   "outputs": [],
   "source": [
    "分数_list_数媒技术1班 = [88,89,90,91,92]\n",
    "分数_list_数媒技术2班 = [93,94,95,96,97]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "617a6cee",
   "metadata": {},
   "outputs": [],
   "source": [
    "分数_list_数媒技术1班.extend(分数_list_数媒技术2班)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "id": "9932d6eb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[88, 89, 90, 91, 92, 93, 94, 95, 96, 97]"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "分数_list_数媒技术1班"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "beedc9f6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[88, 89, 90, 91, 92, 93, 94, 95, 96, 97]"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 等价于\n",
    "[88,89,90,91,92]+[93,94,95,96,97]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1eeee260",
   "metadata": {},
   "source": [
    "> 4.copy()\n",
    ">> 1.在列表中，\"赋值\" 不等价于 \"复制\"  \n",
    ">> 2.真正的复制列表的两种常见方法  \n",
    ">>> 1.copy()  \n",
    ">>> 2.切片[:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "b34e9201",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jake Alex\n",
      "1938511523440\n",
      "1938511541616\n"
     ]
    }
   ],
   "source": [
    "name1=\"Alex\"\n",
    "name2=name1\n",
    "name1=\"Jake\"\n",
    "print(name1,name2)\n",
    "\n",
    "print(id(name1))\n",
    "print(id(name2))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "89361bba",
   "metadata": {},
   "source": [
    "*  结论：赋值情况有俩种情况：  \n",
    "> 1.赋值的数据类型是不可变数据（字符串、数值、元组），分配不同的数据地址  \n",
    "> 2.赋值的类型是可变数据（列表）分配同一个地址指向同一个列表  "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "36486e42",
   "metadata": {},
   "source": [
    "> 4.*copy\n",
    ">> 1.“赋值”不等价于“复制”\n",
    ">> 2.真正的复制列表的俩种方法\n",
    ">>> a.copy()  \n",
    ">>> b.切片[:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "cdba17db",
   "metadata": {},
   "outputs": [],
   "source": [
    "#此案例 来源：课本P72 : 看起来像复制，但其实不是\n",
    "first= [1,2,3,4,5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "8953db5e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, 4, 5]"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "0c788009",
   "metadata": {},
   "outputs": [],
   "source": [
    "second=first"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "b40c9dae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, 4, 5]"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "second"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "id": "ff01905c",
   "metadata": {},
   "outputs": [],
   "source": [
    "first.append(6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "id": "7aff4aec",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5, 6]\n"
     ]
    }
   ],
   "source": [
    "print(first,second)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "4cc3aa0f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1938515904640\n",
      "1938515904640\n"
     ]
    }
   ],
   "source": [
    "print(id(first))\n",
    "print(id(second))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c987a5f5",
   "metadata": {},
   "source": [
    "### 列表的复制（方法一）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "id": "cb1c573e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]\n",
      "1938519553280 1938517477248\n"
     ]
    }
   ],
   "source": [
    "first = [1,2,3,4,5]\n",
    "second = first.copy()\n",
    "\n",
    "print(first,second)\n",
    "print(id(first),id(second))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "id": "a5e7f132",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5]\n"
     ]
    }
   ],
   "source": [
    "first.append(6)\n",
    "print(first,second)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e2b1387b",
   "metadata": {},
   "source": [
    "### 列表的复制（方法二）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e9c9d7ea",
   "metadata": {},
   "source": [
    "* 切片[:] 可以实现真正意义的复制"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "5239a4f0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]\n",
      "1938518998720 1938516274688\n"
     ]
    }
   ],
   "source": [
    "first = [1,2,3,4,5]\n",
    "second = first[:]\n",
    "print(first,second)\n",
    "print(id(first),id(second))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "07f32593",
   "metadata": {},
   "source": [
    "### 思考copy() 只复制 第一层"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "80985bff",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 2, 3, [4, 5, 6]] [1, 2, 3, [4, 5, 6]]\n",
      "1938510696320 1938519553280\n"
     ]
    }
   ],
   "source": [
    "first = [1,2,3,[4,5,6]]\n",
    "second = first.copy()\n",
    "\n",
    "print(first,second)\n",
    "print(id(first),id(second))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "id": "03a87ef7",
   "metadata": {},
   "outputs": [],
   "source": [
    "first[3].append(7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "id": "e04023db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, [4, 5, 6, 7]]"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "id": "9391a1be",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, [4, 5, 6, 7]]"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "second"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "804e8b18",
   "metadata": {},
   "source": [
    "> 6.sort()\n",
    ">> 1.reverse=False (默认从小到大)\n",
    ">> 2.可修改 reverse = True (从大到小)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "id": "523075c0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function sort:\n",
      "\n",
      "sort(*, key=None, reverse=False) method of builtins.list instance\n",
      "    Sort the list in ascending order and return None.\n",
      "    \n",
      "    The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n",
      "    order of two equal elements is maintained).\n",
      "    \n",
      "    If a key function is given, apply it once to each list item and sort them,\n",
      "    ascending or descending, according to their function values.\n",
      "    \n",
      "    The reverse flag can be set to sort in descending order.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(分数_list_数媒技术1班.sort)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "id": "070685ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "分数_list_数媒技术1班.sort()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "id": "d3911526",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[88, 89, 90, 91, 92, 93, 94, 95, 96, 97]"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "分数_list_数媒技术1班"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "6225810e",
   "metadata": {},
   "outputs": [],
   "source": [
    "分数_list_数媒技术1班.sort(reverse = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "id": "27631dc0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[97, 96, 95, 94, 93, 92, 91, 90, 89, 88]"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "分数_list_数媒技术1班"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "73066856",
   "metadata": {},
   "source": [
    "# 列表的实践一（课本）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "id": "417329f2",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', \"'\", 't', ' ', 'p', 'a']\n",
      "['o', 'n', 't', ' ', 'p', 'a']\n",
      "['o', 'n', 't', ' ', 'a', 'p']\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "\n",
    "plist = list(phrase) \n",
    "print(plist)\n",
    "\n",
    "plist.remove('D')\n",
    "print(plist)\n",
    "\n",
    "for i in range(4):\n",
    "    plist.pop()\n",
    "print(plist)\n",
    "\n",
    "plist.pop(2)\n",
    "print(plist)\n",
    "\n",
    "plist.extend([plist.pop(),plist.pop()])\n",
    "\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e9795d8f",
   "metadata": {},
   "source": [
    "* 老师案例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "57e7bd25",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', ' ', 't', 'a', 'p']\n",
      "on tap\n",
      "0.0009584426879882812\n"
     ]
    }
   ],
   "source": [
    "# 目标： \"Don't panic\" => \"on tap\"\n",
    "# 利用列表的 方法 实现\n",
    "实践一运行前时间 = time.time()\n",
    "phrase = \"Don't panic!\"\n",
    "\n",
    "plist = list(phrase) # list(): str --> list\n",
    "print(plist)\n",
    "# 删除 D\n",
    "plist.remove('D')\n",
    "# print(plist)\n",
    "# 删除末尾4个元素 用pop()删除4次\n",
    "for i in range(4):\n",
    "    plist.pop()\n",
    "# print(plist)\n",
    "# 删除‘'’\n",
    "plist.pop(2)\n",
    "# print(plist)\n",
    "# plist.extend([plist.pop(),plist.pop()]) # 难点在于 ：执行的运算先后顺序 先算圆括号，圆括号中从左往右运算\n",
    "# ['o','n','t',' ']  + [ 'a'   ，   'p'  ]\n",
    "plist.insert(4,plist.pop())\n",
    "# print(plist)\n",
    "plist.insert(2,plist.pop(3))\n",
    "#['o', 'n', 't','a','p']  在第二个位置增加  ' '\n",
    "# print(plist)\n",
    "new_phrase = ''.join(plist)\n",
    "print(plist)\n",
    "print(new_phrase)\n",
    "实践一运行后时间 = time.time()\n",
    "实践一代码的执行实践 = 实践一运行后时间-实践一运行前时间\n",
    "print(实践一代码的执行实践)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "id": "94d2e7e4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', \"'\", 't', ' ', 'p', 'a']\n",
      "['o', 'n', 't', ' ', 'p', 'a']\n",
      "['o', 'n', 't', ' ', 'a', 'p']\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "\n",
    "plist = list(phrase) #list()\n",
    "print(plist)\n",
    "\n",
    "plist.remove('D')\n",
    "print(plist)\n",
    "\n",
    "for i in range(4):\n",
    "    plist.pop()\n",
    "print(plist)\n",
    "\n",
    "plist.pop(2)\n",
    "print(plist)\n",
    "\n",
    "plist.insert(4,plist.pop())\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "id": "60397ffa",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', \"'\", 't', ' ', 'p', 'a']\n",
      "['o', 'n', 't', ' ', 'p', 'a']\n",
      "['o', 'n', ' ', 't', 'p', 'a']\n",
      "['o', 'n', ' ', 't', 'p', 'a']\n",
      "on tpa\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "\n",
    "plist = list(phrase) #list()\n",
    "print(plist)\n",
    "\n",
    "plist.remove('D')\n",
    "print(plist)\n",
    "\n",
    "for i in range(4):\n",
    "    plist.pop()\n",
    "print(plist)\n",
    "\n",
    "plist.pop(2)\n",
    "print(plist)\n",
    "\n",
    "plist.insert(2,plist.pop(3))\n",
    "print(plist)\n",
    "\n",
    "new_plist=\"\".join(plist)   # \"\"表示用什么合并，“1”则是'o1n1 1t1p1a'\n",
    "print(plist)\n",
    "print(new_plist)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e5ecdf68",
   "metadata": {},
   "source": [
    "# 列表的实践二（课本）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ca729f91",
   "metadata": {},
   "source": [
    "* 对比 列表的实践一 结论：\n",
    "> 1.列表的方法 会修改 原本的列表 但是 列表的切片 不改变原列表  \n",
    "> 2.使用列表的方法时，需考虑是否需要先复制列表  \n",
    "> 3.思考：如何对比代码的执行效率？ 代码执行后的时间 - 代码执行前的时间  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "id": "21b2438a",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1637426123.563307"
      ]
     },
     "execution_count": 130,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import time\n",
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "id": "c0dd207c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "on tap\n",
      "0.000995635986328125\n"
     ]
    }
   ],
   "source": [
    "# 目标： \"Don't panic\" => \"on tap\"\n",
    "# 利用列表的 切片 实现\n",
    "实践二运行前时间 = time.time()\n",
    "phrase = \"Don't panic!\"\n",
    "\n",
    "plist = list(phrase) # list(): str --> list\n",
    "print(plist)\n",
    "\n",
    "new_phrase = ''.join(plist[1:3])+plist[5]+plist[4]+plist[7]+plist[6]\n",
    "print(plist)\n",
    "print(new_phrase)\n",
    "实践二运行后时间 = time.time()\n",
    "实践二代码的执行实践 = 实践二运行后时间-实践二运行前时间\n",
    "print(实践二代码的执行实践)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7ae3d86c",
   "metadata": {},
   "source": [
    "# 3列表的一般方法\n",
    "\n",
    "\n",
    "| 列表的方法 | Description| 一般用在什么情景下 |\n",
    "| ---------------- | ------------ | ------------- |  \n",
    "|append | 列表的新增：增加元素至列表的末尾 | 新建列表 |  \n",
    "| clear | 列表的清除 | 清空列表元素 |\n",
    "| pop |列表删除：默认删除列表最后一个 | 删除列表最后一个 |\n",
    "| copy |列表复制 \"赋值\" 不等价于 \"复制\" | 需要一个同样的新列表（只可复制第一层）|\n",
    "| count |列表元素的次数 | 需要某元素在列表中出现次数 |\n",
    "| extend |列表大量增加 | 用于一个列表整体添加到另外一个列表的末尾|\n",
    "| index |确定元素索引值 | 寻找列表中当前元素第一次出现的索引位置 |\n",
    "|insert | 元素的插入 | 可将元素的插入确定的索引值位置|\n",
    "|reverse |列表元素倒置 |需将元素倒置可用|\n",
    "|sort |整理列表|列表中的元素已经按一定顺序排列且不可重置|"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "090f7102",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e6054973",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
